package com.lovo.cloud1.controller;

import com.lovo.cloud1.service.MovieService;
import com.lovo.util.dto.MovieDTO;
import com.lovo.util.dto.MovieNumDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @author cwl
 * @date 2020/11/30 16:52
 * @description 购票
 */
@RestController
public class BuyTicketController {

    @Resource
    private MovieService movieService;


    @GetMapping("buy/{name}/{num}")
    public MovieNumDTO login(@PathVariable("name") String name,@PathVariable("num") Integer num) {
        MovieNumDTO movieNumDTO = movieService.buyTicket(name, num);

        return movieNumDTO;

    }
}
